package com.maimao.search.client;

import com.maimao.core.constant.ServiceContainer;
import com.maimao.core.interceptor.FeignInterceptor;
import com.maimao.core.model.resp.Result;
import com.maimao.model.goods.Brand;
import com.maimao.model.goods.vo.GoodsInfo;
import com.maimao.search.client.factory.BrandFallBackFactory;
import com.maimao.search.client.factory.GoodsFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author MaoLin Wang
 * @date 2020/12/22 7:54 下午
 */
@RequestMapping("/goods/brand")
@FeignClient(contextId = "brandClient", value = ServiceContainer.GOODS_SERVICE, fallbackFactory = BrandFallBackFactory.class, configuration = FeignInterceptor.class)
public interface BrandClient {

    /**
     * 分页查询商品信息
     */
    @GetMapping("/client/name")
    Result<String> selectNameById(@RequestParam("id") Long id);

    /**
     * 批量查询
     */
    @GetMapping("/client/brands/batch")
    Result<List<Brand>> selectByIdBatch(@RequestBody List<Long> brandIds);
}
